﻿using System.IO.Ports;
using System.Text;
using Oxage.CNC;
using Oxage.Windows.Controls;
using Arguments = Oxage.Windows.Controls.Arguments;

namespace Oxage.Commands
{
	[CommandLineHandler("sim", "Simulator control")]
	public class SimulatorCommandLineHander : ICommandLineHandler
	{
		#region ICommandLineHandler Members
		public void Run(IConsole console, string line, string command, Arguments args)
		{
			if (args.Count == 0 || args.Help)
			{
				console.WriteLine("Simulator control");
				console.WriteLine();
				console.WriteLine("Usage:");
				console.WriteLine("  sim <command> [parameters]");
				console.WriteLine();
				console.WriteLine("Commands:");
				console.WriteLine("  move [p1,p2,p3,...]");
				console.WriteLine("  arc");
				console.WriteLine("  plane [xy,yz,xz]");
				console.WriteLine();
				console.WriteLine("Examples:");
				console.WriteLine("  sim move 10,20,30");
				console.WriteLine("  sim arc");
				return;
			}

			if (args.Count > 0)
			{
				//string gcode = line.Substring(command.Length + 1).Replace("\\n", "\n");
				//App.ViewModel.MachineController.Write(Encoding.ASCII.GetBytes(gcode));
				//console.WriteLine(gcode);
			}
		}
		#endregion
	}
}
